Skip to content

feat(stream): implement declared event ingress - #300

Merged
schickling merged 26 commits into
mainfrom
schickling/2026-08-20-streams-ready
Aug 20, 2026
Merged

feat(stream): implement declared event ingress#300
schickling merged 26 commits into
mainfrom
schickling/2026-08-20-streams-ready

Conversation

@schickling

@schickling schickling commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the stream subsystem specified by #287 as its dependent implementation PR.

  • admits typed nested stream declarations with command, argv, or external ingress
  • lowers launched streams directly to lifecycle-coupled derived exec companions
  • adds source-preserving st2 stream add/rm authoring
  • adds bounded, idempotent st2 event emit ingress with keyed and keyless supersession
  • publishes ordinary inbox records and reuses existing archive/DING safety
  • resolves the st2 VRS implementation delta

Verification

PASS:

  • local nix flake check --print-build-logs (all 9 x86_64-linux checks)
  • formatting and workspace all-target checks
  • event E2E: 14/14
  • Agent Spec discovery: 55/55
  • message CLI: 18/18
  • authoring, lifecycle, wire, and invariant proofs

Canonical failure-capable E2E proof is in compoundingtech/evals#79, exact-pinned to 29dec2f3c9dc0f9eb980f913e9c972c3f10785f1; its stream cell passes 8/8 and complete corpus preflight passes.

Stack

The branch base preserves the dependency. GitHub stack metadata was removed after it repeatedly reported a false conflict for a direct-descendant head.

Originally managed with GitHub Stacks CLI

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fa21f1221

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent_author.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 493bc5cb70

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/event.rs Outdated
Comment thread src/main.rs
@schickling
schickling changed the base branch from schickling/2026-08-20-pipes to main August 20, 2026 10:39
@schickling
schickling changed the base branch from main to schickling/2026-08-20-pipes August 20, 2026 10:39
@schickling

Copy link
Copy Markdown
Contributor Author

Refreshing hosted checks after the doc-only waiter-contract commit; candidate bytes remain at 493bc5c.

@schickling schickling closed this Aug 20, 2026
@schickling schickling reopened this Aug 20, 2026
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch from 493bc5c to 0c7a94f Compare August 20, 2026 11:43
@schickling
schickling changed the base branch from schickling/2026-08-20-pipes to main August 20, 2026 11:44
@schickling
schickling changed the base branch from main to schickling/2026-08-20-pipes August 20, 2026 11:44
@schickling

Copy link
Copy Markdown
Contributor Author

Refreshing mergeability and exact-head checks after the reviewed semantic rebase onto #287.

@schickling schickling closed this Aug 20, 2026
@schickling schickling reopened this Aug 20, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c7a94ffa0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/agent-spec/src/spec.rs
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch 2 times, most recently from 474e6c0 to 47c4aed Compare August 20, 2026 11:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47c4aed618

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/event.rs
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch from 47c4aed to 15c63a9 Compare August 20, 2026 12:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15c63a9c48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/event.rs Outdated
Comment thread src/event.rs Outdated
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch from 15c63a9 to 6e06b55 Compare August 20, 2026 12:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e06b55100

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/agent-spec/src/spec.rs
Comment thread src/event.rs Outdated
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch 2 times, most recently from 389eeb8 to ffdb83c Compare August 20, 2026 12:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffdb83c954

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/event.rs
Comment thread src/event.rs Outdated
Comment thread src/event.rs Outdated
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch from ffdb83c to 96852d2 Compare August 20, 2026 12:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96852d2baa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent_author.rs
Comment thread src/main.rs
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch from 96852d2 to f21f486 Compare August 20, 2026 12:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2840c80fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/event.rs Outdated
Comment thread src/event.rs Outdated
@schickling
schickling force-pushed the schickling/2026-08-20-streams-ready branch from b2840c8 to b44cfcd Compare August 20, 2026 13:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b44cfcd085

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent_author.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e650090a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/event.rs
Comment thread src/event.rs Outdated
@schickling
schickling merged commit 9b1a3b4 into main Aug 20, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6138aa8a1b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent_author.rs
let spec = found
.specs
.iter()
.find(|spec| spec.path == target.declaration)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve the exact agent before retiring its adapter

When one KDL file contains multiple agents and a launched stream is removed from an agent other than the first spec for that path, this lookup selects the wrong agent. It can consequently skip retirement or retire another agent's same-named runtime, after which edit_stream_declaration removes the correct target declaration and leaves its adapter alive and unmanaged. Fresh evidence after the earlier adapter-retirement fix is this path-only reselection; match the target identity and host as well as its declaration path.

Useful? React with 👍 / 👎.

schickling added a commit that referenced this pull request Aug 22, 2026
…s unsupported (#309)

archive_validated_file hardlinks the validated predecessor through
/proc/self/fd/N (Linux) or /dev/fd/N (elsewhere) with AT_SYMLINK_FOLLOW.
Linux procfs permits materializing that link; macOS fdescfs answers with
EPERM, so publication failed on every Darwin host and cargo test -p st2
--lib could not pass there since #300.

Classify EPERM/ENOSYS/EOPNOTSUPP from the capability linkat as
platform-unsupported and install the receipt as a staged, fsynced,
rename_noreplace byte copy instead; every other error stays a hard
failure. The caller's readback proves whichever receipt won carries the
validated bytes, so supersession semantics are unchanged. The tradeoff is
inode identity: a crash between copy and conditional unlink leaves the
retained inbox entry in place until revalidation.

A debug-only TEST_FORCE_ARCHIVE_RECEIPT_COPY switch exercises the
fallback on every platform; the new ding supersession test asserts receipt
bytes match and no staging files leak into the archive.

Fixes #308
schickling added a commit that referenced this pull request Aug 23, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 23, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 23, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 23, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 23, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 24, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 24, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling added a commit that referenced this pull request Aug 24, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling-assistant pushed a commit that referenced this pull request Aug 24, 2026
…d human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
schickling-assistant added a commit that referenced this pull request Aug 24, 2026
…d human output (#322)

* feat(agents): join observed harness state into the roster, doctor, and human output

The chosen $E surface from #268: an appended observedState object on both
roster JSON shapes (null = no record, distinct from derived unknown), a
compact observed column in human output, and advisory-only doctor lines.
The session-liveness cross-check demands positive evidence of death
(ding::session_liveness); an unreadable registry downgrades nothing.
Row 22's wording now names the third independent axis with its proof, and
two stale stream proof references from the #300/#313 renames are corrected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(agents): catalog-derived probe root, explicit nulls, and labeled observed output

Review-pass fixes for the exposure slice: the session-liveness probe
derives the runner's own pty root from the catalog (PTY_ROOT and
PTY_SESSION_DIR still win) so operator shells get the cross-check without
exporting anything, with the errno mapping now unit-tested; observedState
serializes exit and reason as explicit null per the roster's
null-not-omit convention; Doctor gains the ended-while-desired-running
crashed-seat advisory and tests covering all four observed-state arms;
and the human observed column is prefixed obs: so two bare state words
never sit ambiguously side by side.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(agents): probe exactly the runner's pty root and expose the ask kind

PTY_SESSION_DIR pointed the probe at a directory st2-managed sessions
never use (provable deaths read indeterminate); the probe now shares
run::effective_pty_root verbatim. observedState gains the machine-readable
ask axis, pinned literals updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(agents): observedState field order matches the documented contract

reason precedes exit, as the spec example pins; pinned literals updated
in the same change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(agents): doctor reports a reason-only terminal instead of exit unstated

An ended record can carry only a reason — Codex's observed systemError
writes reason without an exit — and the catch-all advisory discarded it,
leaving the operator 'exit unstated' with nothing to act on. The advisory
now falls back to the recorded reason when no exit is present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@f33cd9c-dirty

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: schickling-assistant <261620128+schickling-assistant@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant